package books.to.africa
import grails.plugins.springsecurity.Secured

class DonorHomeController {
	def springSecurityService
    def index = {redirect (action:home)}
    def home = {
def curuser = currentUser()
render (view: "donorHome.gsp", model: [user:curuser ])}

	private currentUser(){
	return DonorRegister.get(springSecurityService.principal.id)
}

	def viewMyBooks = {

		DonorRegister currentUser = currentUser()
	render "${currentUser.username} ${currentUser.email} books: ${currentUser.books}"
}
	def donateBookForm = {render (view: "donateBook.gsp")}

}
